package com.dtstack.properties;

import com.dtstack.po.Person;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Properties;

/**
 * @author chuanbai
 * @date 2024/4/27 22:53
 * @deception
 */
public class PropertiesUtil {
    public static void getProperties(Person person) throws IOException {
        Properties properties = new Properties();
        properties.load(new FileInputStream("hello-springboot-starter/src/main/resources/test.properties"));
        //得到配置文件key的名字
        Enumeration enumeration = properties.propertyNames();
        while (enumeration.hasMoreElements()){
            String key =(String)enumeration.nextElement();
            String value = properties.getProperty(key);
            System.out.println("key="+key+"——————value="+value);
            //封装到JavaBean
            //以下内容省略
        }
    }
}

